{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Note: you may need to restart the kernel to use updated packages.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: Package(s) not found: tushare\n"
     ]
    }
   ],
   "source": [
    "%pip show tushare"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'tushare'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[8], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mtushare\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mts\u001b[39;00m\n\u001b[0;32m      4\u001b[0m ts\u001b[38;5;241m.\u001b[39mset_token(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m8ea198880d3a6f451dc99fdce8d92a52dd0090c82563cee2f1b5694c\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m      5\u001b[0m pro \u001b[38;5;241m=\u001b[39m ts\u001b[38;5;241m.\u001b[39mpro_api()\n",
      "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'tushare'"
     ]
    }
   ],
   "source": [
    "import tushare as ts\n",
    "\n",
    "\n",
    "ts.set_token('8ea198880d3a6f451dc99fdce8d92a52dd0090c82563cee2f1b5694c')\n",
    "pro = ts.pro_api()\n",
    "\n",
    "params = {\n",
    "    \"ts_code\": \"601939.SH\",\n",
    "    \"trade_date\": \"\",\n",
    "    \"start_date\": 20100101,\n",
    "    \"end_date\": 20241225,\n",
    "    \"offset\": \"\",\n",
    "    \"limit\": \"\",\n",
    "    \"fields\": [\n",
    "        \"ts_code\",\n",
    "        \"trade_date\",\n",
    "        \"open\",\n",
    "        \"high\",\n",
    "        \"low\",\n",
    "        \"close\",\n",
    "        \"pre_close\",\n",
    "        \"change\",\n",
    "        \"pct_close\",\n",
    "        \"change\",\n",
    "        \"pct_chg\",\n",
    "        \"vol\",\n",
    "        \"amount\"\n",
    "    ]\n",
    "}\n",
    "df = pro.daily(params)\n",
    "print(df)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
